package com.lankystar.sos.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 用户实体了
 * @author SYX
 *
 */
@Entity
@Table(name="sos_user")
public class User implements Serializable{

	private static final long serialVersionUID = 1L;
	/**
	 * id、用户名、注册手机号、密码、邮箱、头像、生日、性别、注册时间、最后修改时间
	 */
	private int userId;
	private String userNickName;
	private String userPhone;
	private String userPassword;
	private String userEmail;
	private String userPortrait;
	private Date userBirthday;
	private String userGender;
	private Date userCreateTime;
	private Date userLastEditTime;
	private UserApprove userApprove;
	private UserLocation location;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getUserNickName() {
		return userNickName;
	}
	public void setUserNickName(String userNickName) {
		this.userNickName = userNickName;
	}
	public String getUserPhone() {
		return userPhone;
	}
	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}
	public String getUserPassword() {
		return userPassword;
	}
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
	public String getUserEmail() {
		return userEmail;
	}
	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}
	public String getUserPortrait() {
		return userPortrait;
	}
	public void setUserPortrait(String userPortrait) {
		this.userPortrait = userPortrait;
	}
	@Temporal(TemporalType.DATE)
	public Date getUserBirthday() {
		return userBirthday;
	}
	public void setUserBirthday(Date userBirthday) {
		this.userBirthday = userBirthday;
	}
	@Temporal(TemporalType.DATE)
	public Date getUserCreateTime() {
		return userCreateTime;
	}
	public void setUserCreateTime(Date userCreateTime) {
		this.userCreateTime = userCreateTime;
	}
	public String getUserGender() {
		return userGender;
	}
	public void setUserGender(String userGender) {
		this.userGender = userGender;
	}
	@Temporal(TemporalType.DATE)
	public Date getUserLastEditTime() {
		return userLastEditTime;
	}
	public void setUserLastEditTime(Date userLastEditTime) {
		this.userLastEditTime = userLastEditTime;
	}
	@OneToOne(mappedBy="user",cascade=CascadeType.ALL)
	public UserApprove getUserApprove() {
		return userApprove;
	}
	public void setUserApprove(UserApprove userApprove) {
		this.userApprove = userApprove;
	}
	@OneToOne(mappedBy="user")
	public UserLocation getLocation() {
		return location;
	}
	public void setLocation(UserLocation location) {
		this.location = location;
	}
	
	
}
